package collect;

import java.util.LinkedList;

import dbaccess.dbInteract;

/**
 * StockCollections will connect with the backend database to obtain all the information regarding
 * stock names and symbols. Specifically, it will interface with the Stocks table.
 * 
 * @author henry
 *
 */
public class StockCollections{

	/**
	 * All the information is stored in a linked list, containing elements of type StockPairs
	 */
	public static LinkedList<StockPairs> ll = new LinkedList<StockPairs>();
	
	/**
	 * The default constructor for this class. It queries the database, then stores the results in
	 * a linked list.
	 */
	public StockCollections(){
		
		//ll.add(new StockPairs("Google", "GOOG"));
		//ll.add(new StockPairs("Yahoo", "YHOO"));
		//ll.add(new StockPairs("NVIDIA", "NVDA"));
		//ll.add(new StockPairs("Microsoft", "MSFT"));
								
		dbInteract.dbLoadStockPairs(ll);
	}
	
	/**
	 * Returns a linked list with the names and symbols of the stocks in the database
	 * @return A linked list with StockPairs, containing the names and symbols of all stocks in the database
	 */
	public LinkedList<StockPairs> getStocks(){return ll;}

}
